package com.example.multichanneldemo;

import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.widget.TextView;

public class MainActivity extends AppCompatActivity {

    private TextView tv;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        tv = findViewById(R.id.tv);
        ApplicationInfo info = null;
        TextView textView = findViewById(R.id.tv);
        try {
            info = this.getPackageManager().getApplicationInfo(getPackageName(), PackageManager.GET_META_DATA);
            String msg = info.metaData.getString("MY_CHANNEL");
            textView.setText(msg);
        } catch (PackageManager.NameNotFoundException e) {
            e.printStackTrace();
        }
    }
}
